package com.nchuoj.question.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nchuoj.question.mapper.QuestionMapper;
import com.nchuoj.question.service.QuestionService;
import org.springframework.stereotype.Service;
import com.nchuoj.question.pojo.Question;


/**
* @author lenovo
* @description 针对表【question】的数据库操作Service实现
* @createDate 2022-12-24 16:30:17
*/
@Service
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question>
    implements QuestionService {

    /**
     * 根据题目id查询一个题目
     *
     * @param id 题目id
     * @return question 返回一个题目对象
     */
    @Override
    public Question getQuestionById(Object id) {
        LambdaQueryWrapper<Question> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Question::getId, id);
        return this.getOne(queryWrapper);
    }
}




